{% extends "../base_adminlte.html" %}
{% block content %}
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
    <div class="content-header">
    </div>
    <section class="content">
        <div class="input-group col-md-12">
            <div class="col-sm-12" >
              <p face="黑体">
                  计算方法：为以资产标签查询相应资产的每月折旧金额，乘于有效统计月份+本年已折旧金额，当剩余折旧月份小于统计月份时，以剩余折旧月份作为有效统计月份，其余情况为统计月份
              </p>
              <label >请输入资产标签，以","分隔</label>
              <textarea style="height:500px" type="text" id="assetlabels" class="form-control" name="vars"  rows="12" ></textarea>
            </div>
            <div class="form-group col-sm-4 col-md-4" >
              <label >请输入统计月份</label>
              <input class="form-control" type="text" id="monthline" name="monthline"  autocomplete="off">
            </div>
        </div>
        <div class="col-sm-12" >
            <button type="button" id="depcalc" class="btn btn-default">折旧计算</button>
            <button class="btn btn-default" onclick="location.href='/ansible/assets'" type="button" value="取消" >返回</button></td>
        </div>
        <div class="col-sm-12" style="margin-top: 1%">
            <label>result: </label><label id="result" ></label>
        </div>
    </section>
</div>
{% endblock %}

{% block scriptcontent %}
<script>
  $('#depcalc').click(function(){
        $.ajax({
            url: '/ansible/depcalc/',
            data:{"assetlabels":$('#assetlabels').val(), "monthline":$('#monthline').val()},
            type: 'POST',
            dataType: 'json',
            success: function(data){
               $('#result').text(data);
            },
        });
    });
</script>
{% endblock %}